package com.dream.house.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import cn.com.servyou.base.exception.ServiceException;
import cn.com.servyou.utils.Page;

import com.dream.house.dao.DocumentDAO;
import com.dream.house.entity.DocumentDTO;


public class DocumentService extends HouseBaseService{
	
	@Autowired
	private DocumentDAO docDAO;
	
	public boolean saveDoc(DocumentDTO dto) throws ServiceException{
		dto.setDoc_id(docDAO.getMaxId());
		
		return docDAO.saveDoc(dto);
	}

	boolean grant(String id, String status, String checkUser)
			throws ServiceException {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	boolean check(Map<String, String> condition) throws ServiceException {
		// TODO Auto-generated method stub
		return false;
	}
	
	public boolean updateDoc(DocumentDTO dto) throws ServiceException{
		return docDAO.updateDoc(dto);
	}
	
	public boolean removeDoc(String id) throws ServiceException{
		return docDAO.removeDoc(id);
	}
	
	public DocumentDTO getDoc(String id) throws ServiceException{
		
		return docDAO.getDoc(id);
	}
	
	public Page findByPage(Map<String, Object> condition, int pageNo,
			int pageSize) throws ServiceException{
		
		return docDAO.findByPage(condition, pageNo, pageSize);
	}
	
}
